﻿#include <QGuiApplication>
#include <QApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include "MyObject.h"
#include <QMessageBox>

int main(int argc, char *argv[]) {
    QApplication app(argc, argv);
    QQmlApplicationEngine engine;
    qApp->aboutQt();
    // 显示 Qt 版本信息对话框
    // QMessageBox::aboutQt(nullptr,QString::fromUtf8("关于 Qt"));
    // 注册C++对象到QML上下文
    MyObject myObj;
    engine.rootContext()->setContextProperty("myObject", &myObj);

    // QString debuggerParams = "port=12150,block";
    // engine.rootContext()->setContextProperty("debuggerParams", debuggerParams);
    engine.load(QUrl(QStringLiteral("qrc:/main.qml")));

    // 加载QML文件
    // engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
    // engine.load(QUrl(QStringLiteral("file:///D:\\AllGits\\xmake_project\\test_qml2\\src\\main.qml")));
    return app.exec();
}